From: Matthieu Gallien Date: Thu, 27 Mar 2025 14:25:49 +0000 (+0100) Subject: no need to disable buffering from Qt in POST requests X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2^2~37^2~4 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success/%22http:/www.example.com/cgi/success?a=commitdiff_plain;h=39cf125c179ae478e493313736c033078865fb4b;p=nextcloud-desktop.git no need to disable buffering from Qt in POST requests data of the files are ready in a memory buffer so Qt will not buffer them anyway Signed-off-by: Matthieu Gallien --- diff --git a/src/libsync/putmultifilejob.cpp b/src/libsync/putmultifilejob.cpp index 99825dd04..5c132de33 100644 --- a/src/libsync/putmultifilejob.cpp +++ b/src/libsync/putmultifilejob.cpp @@ -41,8 +41,6 @@ void PutMultiFileJob::start() { QNetworkRequest req; - auto fullSize = 0; - for(const auto &oneDevice : _devices) { // Our rate limits in UploadDevice::readData will cause an application freeze if used here. // QHttpMultiPart's internal QHttpMultiPartIODevice::readData will loop over and over trying @@ -53,7 +51,6 @@ void PutMultiFileJob::start() auto onePart = QHttpPart{}; - fullSize += oneDevice._device->size(); if (oneDevice._device->size() == 0) { onePart.setBody({}); } else { @@ -74,9 +71,6 @@ void PutMultiFileJob::start() _body.append(onePart); } - req.setAttribute(QNetworkRequest::DoNotBufferUploadDataAttribute, true); - req.setHeader(QNetworkRequest::ContentLengthHeader, fullSize); - sendRequest("POST", _url, req, &_body); if (reply()->error() != QNetworkReply::NoError) {